Function isotope_parser::utils::multiline_comment[][src]

pub fn multiline_comment(input: &str) -> IResult<&str, &str>
Expand description

Parse a multi-line comment.

Multi-line comments are delimited by /* and */, and may be nested, e.g.

/*
I'm a comment!
    /*
    I'm a nested comment!
    */
*/

Example

assert_eq!(
    multiline_comment("/* comment */hello"),
    Ok(("hello", " comment "))
);
assert_eq!(
    multiline_comment("/*/*nested*/*//*other*/"),
    Ok(("/*other*/", "/*nested*/"))
);
assert_eq!(
    multiline_comment(
        "/* deeply /*/* nested */ and */ se /* parated */ */"
    ),
    Ok(("", " deeply /*/* nested */ and */ se /* parated */ "))
);